<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022\2\23 0023
 * Time: 10:59
 */
function test()
{
    $array = array(
        array(
            'id' => 1
        ),
        array(
            'id' => 2
        )

    );
    foreach ($array as $value) {
      $res=  test2($value);
        var_dump($res);
    }

}

function test2($value)
{
    if ($value['id'] == 1) {
        return true;
    }
    if ($value['id'] == 3) {
        echo 99;
        return 99;
    }
}

test();

//返回结果
//bool(true) NULL